﻿using System;
using System.ComponentModel;
using Loki.Utils;

namespace Luna.UI.Budget
{
    public class DisplayableBudget : LunaDisplayable
    {
        #region Name

        private static PropertyChangedEventArgs _NameChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudget>(x => x.Name);

        private static PropertyChangingEventArgs _NameChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudget>(x => x.Name);

        private string _Name;

        public string Name
        {
            get
            {
                return _Name;
            }

            set
            {
                if (value != _Name)
                {
                    NotifyChanging(_NameChangingArgs);
                    _Name = value;
                    NotifyChanged(_NameChangedArgs);
                }
            }
        }

        #endregion Name

        #region Start

        private static PropertyChangedEventArgs _StartChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudget>(x => x.Start);

        private static PropertyChangingEventArgs _StartChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudget>(x => x.Start);

        private DateTime _Start;

        public DateTime Start
        {
            get
            {
                return _Start;
            }

            set
            {
                if (value != _Start)
                {
                    NotifyChanging(_StartChangingArgs);
                    _Start = value;
                    NotifyChanged(_StartChangedArgs);
                }
            }
        }

        #endregion Start

        #region Code

        private static PropertyChangedEventArgs _CodeChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudget>(x => x.Code);

        private static PropertyChangingEventArgs _CodeChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudget>(x => x.Code);

        private string _Code;

        public string Code
        {
            get
            {
                return _Code;
            }

            set
            {
                if (value != _Code)
                {
                    NotifyChanging(_CodeChangingArgs);
                    _Code = value;
                    NotifyChanged(_CodeChangedArgs);
                }
            }
        }

        #endregion Code

        #region End

        private static PropertyChangedEventArgs _EndChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudget>(x => x.End);

        private static PropertyChangingEventArgs _EndChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudget>(x => x.End);

        private DateTime _End;

        public DateTime End
        {
            get
            {
                return _End;
            }

            set
            {
                if (value != _End)
                {
                    NotifyChanging(_EndChangingArgs);
                    _End = value;
                    NotifyChanged(_EndChangedArgs);
                }
            }
        }

        #endregion End
    }
}